package com.cskaoyan.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;


/**
 * @author 1784549954@qq.com
 * @since 2022/11/17 21:08
 */
@RestController
@RequestMapping("test")
public class TestController {

    @RequestMapping("hello")
    public String hello(HttpServletResponse response) throws IOException {
//        response.getWriter().println("hello");
        return "hello by heheer";
    }

    @RequestMapping("login/{user}")
    public String login(@PathVariable("user")String user){
        return "Welcome, " + user;
    }
}
